﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;

namespace Weixin.MP.UI
{
    [Serializable]
    public class DwzJsonResult
    {
        /// <summary>
        /// 状态码200成功300操作失败301会话超时...
        /// </summary>
        [JsonProperty("statusCode")]
        public DwzStatusCode StatusCode { get; set; }

        /// <summary>
        /// 提示消息
        /// </summary>
        [JsonProperty("message")]
        public string Message { get; set; }

        /// <summary>
        /// 刷新框架id
        /// </summary>
        [JsonProperty("navTabId")]
        public string NavTabId { get; set; }

        /// <summary>
        /// 关闭操作
        /// </summary>
        [JsonProperty("rel")]
        public string Rel { get; set; }

        /// <summary>
        /// 返回操作，closeCurrent：会关闭当前tab；forward：打开forwardUrl地址；forwardConfirm：
        /// </summary>
        [JsonProperty("callbackType")]
        public string CallbackType { get; set; }

        /// <summary>
        /// 跳转URL地址
        /// </summary>
        [JsonProperty("forwardUrl")]
        public string ForwardUrl { get; set; }

        /// <summary>
        /// confirmMsg这是navTabAjaxDone中 forwardConfirm时的提示信息
        /// </summary>
        [JsonProperty("confirmMsg")]
        public string ConfirmMsg { get; set; }
        public DwzJsonResult()
        {
            Message = string.Empty;
            NavTabId = string.Empty;
            Rel=string.Empty;
            CallbackType = string.Empty;
            ForwardUrl = string.Empty;
            ConfirmMsg = string.Empty;
        }
    }

    /// <summary>
    /// dwz框架状态码
    /// </summary>
    [Serializable]
    public enum DwzStatusCode
    {
        /// <summary>
        /// 成功
        /// </summary>
        Ok = 200,

        /// <summary>
        /// 失败/异常
        /// </summary>
        Error = 300,

        /// <summary>
        /// 会话超时
        /// </summary>
        Timeout = 301
    }
}
